<template>
  <main class="px-[10px] pb-[60px]">
    <section
      v-for="(i, index) in scoreList"
      :key="i.key"
      class="bg-white w-full px-[14px] py-[15.5px] enter-y"
      :class="index === 0 ? 'mt-[10px]' : 'mt-[18.5px]'"
    >
      <h1 class="text-[18px] text-[#464646]">
        {{ i.test_name }}
      </h1>
      <p class="mt-[14.5px] text-[13.5px] text-[#464646]"> 单选题：{{ i.single_score }} </p>
      <p class="mt-[12px] text-[13.5px] text-[#464646]"> 多选题：{{ i.selection_score }} </p>
      <p class="mt-[12px] text-[13.5px] text-[#464646]"> 判断题：{{ i.judge_score }} </p>
      <p class="text-[15px] text-[#464646] mt-[15px]"> 成绩：{{ i.sum_score }} </p>
    </section>
  </main>
</template>

<script setup lang="ts">
  import { useUserInfoStoreWithOut } from '@/stores/modules/userInfo';
  import { getStudentAppScore } from '@/api/user';
  import { ExamRecord } from '@/utils/interface';
  const { getUserId } = storeToRefs(useUserInfoStoreWithOut());
  let scoreList = ref<ExamRecord[]>([]);
  const getStudentScore = async () => {
    const { data } = await getStudentAppScore(getUserId.value);
    scoreList.value = data;
  };
  getStudentScore();
</script>
